package com.starlink.model.util;

import com.starlink.model.dtomapper.MallPeripheryOrderDtoMapper;
import com.starlink.model.domain.MallPeripheryOrderDO;
import com.starlink.model.vo.MallPeripheryOrderVO;
import com.google.common.collect.Lists;
import org.apache.commons.collections4.CollectionUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhanghong
 */
public class MallPeripheryOrderConvert {

    public static List<MallPeripheryOrderVO> buildMallPeripheryOrderVoList(List<MallPeripheryOrderDO> mallPeripheryOrderDOList) {
        if (CollectionUtils.isEmpty(mallPeripheryOrderDOList)) {
            return Lists.newArrayList();
        }
        List<MallPeripheryOrderVO> mallPeripheryOrderVOList = new ArrayList<>();
        for (MallPeripheryOrderDO mallPeripheryOrderDO : mallPeripheryOrderDOList) {
            mallPeripheryOrderVOList.add(MallPeripheryOrderDtoMapper.INSTANCE.do2VO(mallPeripheryOrderDO));
        }

        return mallPeripheryOrderVOList;
    }
}
